// power under jQuery
(function($){

	// system root name 
	System = {
		// a logger
		logger : {
			log : function(level, m){
				// converse the message
				m = m instanceof Error ? m.getMessage() : m.toString()
				// log action path 
				var log_url = 'logger.html';
				
				// begin to request log
				$.ajax({
					url : log_url,
					type : 'post',
					data : {
						level : level,
						message : m.toString()
					}
				});
			},
			info : function(message){
				this.log('info', message);
			},
			warning : function(message){
				this.log('warning', message);
			},
			error : function(message){
				this.log('error', message);
				throw new Error(message);
			}
		}
	};
	
	// set to public
	window.System = System 
	
})(jQuery);